package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Result;
import org.jsola.hr.dto.*;
import org.jsola.hr.vo.*;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/**
 * @author JanusMix
 */
@Api(tags = "hr-小程序员工相关信息")
public interface IHrEmpInfoRelationControllerAPI {

//    /**
//     * 生成ticket
//     * @param empTicketDTO 手机号、unionId
//     * @return Boolean
//     */
//    @ApiOperation(value = "发送短信验证码")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "empTicketDTO", value = "ticketDTO", dataType = "EmpTicketDTO", paramType = "body")
//    })
//    Result<Boolean> genTicket(@RequestBody EmpTicketDTO empTicketDTO);

    /**
     * 发送短信验证码
     * @param phone 手机号
     * @return Boolean
     */
    @ApiOperation(value = "发送短信验证码")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneVerificationCodeDTO", value = "手机号", dataType = "PhoneVerificationCodeDTO", paramType = "query")
    })
    Result<Boolean> hrSendShortMessage(@Valid @RequestBody String phone);

    /**
     * 发送短信验证码
     * @param phone 手机号
     * @return Boolean
     */
    @ApiOperation(value = "发送短信验证码")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneVerificationCodeDTO", value = "手机号", dataType = "PhoneVerificationCodeDTO", paramType = "query")
    })
    Result<Boolean> hrSendShortMessageByDeviceType(@Valid @RequestBody String phone);


    /**
     * 短信验证码登录
     * @param phoneVerificationCodeDTO 手机号验证码DTO
     * @return EmpInfoVO
     */
    @ApiOperation(value = "短信验证码登录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneVerificationCodeDTO", value = "手机号验证码DTO", dataType = "PhoneVerificationCodeDTO", paramType = "body")
    })
    Result<EmpAllInfoVO> hrVerificationCodeLogin(@Valid @RequestBody PhoneVerificationCodeDTO phoneVerificationCodeDTO);

    /**
     * 短信验证码登录（微信小程序登录）
     * @param phoneVerificationCodeDTO 手机号验证码ticketDTO
     * @return EmpInfoVO
     */
    @ApiOperation(value = "短信验证码登录（微信小程序登录失败跳转）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneVerificationCodeDTO", value = "手机号验证码ticketDTO", dataType = "PhoneVerificationCodeDTO", paramType = "body")
    })
    Result<EmpLoginResultVO> hrVerificationCodeLoginWeChat(@RequestBody PhoneVerificationCodeDTO phoneVerificationCodeDTO);

    /**
     * 短信验证码校验（微信小程序登录 根据devicetype查询配置信息）
     * @param phoneVerificationCodeDTO 手机号验证码ticketDTO
     * @return EmpInfoVO
     */
    @ApiOperation(value = "短信验证码登录（微信小程序登录失败跳转）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneVerificationCodeDTO", value = "手机号验证码ticketDTO", dataType = "PhoneVerificationCodeDTO", paramType = "body")
    })
    Result<EmpLoginResultVO> hrVerificationCodeLoginWeChatByDevicetype(@RequestBody PhoneVerificationCodeDTO phoneVerificationCodeDTO);
    
    /**
     * 短信验证码登录（小程序管理端登录）
     * @param phoneVerificationCodeDTO 手机号验证码ticketDTO
     * @return EmpInfoVO
     */
    @ApiOperation(value = "短信验证码登录（小程序管理端登录失败跳转）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneVerificationCodeDTO", value = "手机号验证码ticketDTO", dataType = "PhoneVerificationCodeDTO", paramType = "body")
    })
    Result<EmpLoginResultVO> hrVerificationCodeLoginWeChatForAdmin(@RequestBody PhoneVerificationCodeDTO phoneVerificationCodeDTO);

    /**
     * 短信验证码校验（微信小程序验证码校验（没有业务逻辑） 根据devicetype查询配置信息）
     * @param phoneVerificationCodeDTO 手机号验证码ticketDTO
     * @return EmpInfoVO
     */
    @ApiOperation(value = "微信小程序验证码校验（没有业务逻辑）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneVerificationCodeDTO", value = "手机号验证码ticketDTO", dataType = "PhoneVerificationCodeDTO", paramType = "body")
    })
    Result<String> hrVerificationCodeLoginWeChatByDevicetypeNoLogic(@RequestBody PhoneVerificationCodeDTO phoneVerificationCodeDTO);

    /**
     * 公众号绑定手机号验证码校验
     * @param phoneVerificationCodeDTO 手机号验证码ticketDTO
     * @return EmpInfoVO
     */
    @ApiOperation(value = "公众号绑定手机号验证码校验")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phoneVerificationCodeDTO", value = "手机号验证码ticketDTO", dataType = "PhoneVerificationCodeDTO", paramType = "body")
    })
    Result<Boolean> hrVerificationCodeOfficialAccount(@RequestBody PhoneVerificationCodeDTO phoneVerificationCodeDTO);

    /**
     * 公司员工所需信息详情
     *
     * @param ticket ticket
     * @return 公司员工所需信息详情
     */
    @ApiOperation(value = "公司员工所需填写的信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path")
    })
    Result<CompanyEmpAllInfoRequireVO> findEmpInfoRequire(String ticket);

    /**
     * 部门列表
     *
     * @param ticket ticket
     * @return 部门列表
     */
    @ApiOperation(value = "部门列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path")
    })
    Result<List<DepInfoListVO>> listAllDepInfo(String ticket);

    /**
     * 部门列表(树型)
     *
     * @param ticket ticket
     * @return 部门列表
     */
    @ApiOperation(value = "部门列表(树型)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path")
    })
    Result<List<DepInfoListVO>> listTreeDepInfo(String ticket);

    /**
     * 岗位列表
     *
     * @param ticket ticket
     * @return 部门列表
     */
    @ApiOperation(value = "岗位列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path")
    })
    Result<List<PositionInfoListVO>> listAllPositionInfo(String ticket);

    /**
     * 岗位列表(树型)
     *
     * @param ticket ticket
     * @return 部门列表
     */
    @ApiOperation(value = "岗位列表(树型)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path")
    })
    Result<List<PositionInfoListVO>> listTreePositionInfo(String ticket);



    /**
     * 新增员工工作经历
     * @param empWorkAddDTO 员工工作经历新增实体
     * @return 员工工作经历展示对象
     */
    @ApiOperation(value = "新增员工工作经历")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path"),
            @ApiImplicitParam(name = "empWorkAddDTO", dataType = "EmpWorkAddDTO", value = "新增员工工作经历", paramType = "body")
    })
    Result<EmpWorkVO> saveWork(String ticket, EmpWorkAddDTO empWorkAddDTO);

    /**
     * 修改员工工作经历
     * @param empWorkUpdateDTO 员工工作经历
     * @return 更新数量
     */
    @ApiOperation(value = "修改员工工作经历")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path"),
            @ApiImplicitParam(name = "empWorkUpdateDTO", dataType = "EmpWorkUpdateDTO", value = "修改员工工作经历", paramType = "body")
    })
    Result<Integer> updateWork(String ticket, EmpWorkUpdateDTO empWorkUpdateDTO);

    /**
     * 删除单个员工工作经历，彻底删除
     * @param empWorkId 员工工作经历id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个员工工作经历，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path"),
            @ApiImplicitParam(name = "empWorkId", dataType = "String", value = "员工工作经历id", paramType = "path")
    })
    Result<Integer> deleteWork(String ticket, String empWorkId);

    /**
     * 新增员工教育经历
     * @param empEducationAddDTO 员工教育经历新增实体
     * @return 员工教育经历展示对象
     */
    @ApiOperation(value = "新增员工教育经历")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path"),
            @ApiImplicitParam(name = "empEducationAddDTO", dataType = "EmpEducationAddDTO", value = "新增员工教育经历", paramType = "body")
    })
    Result<EmpEducationVO> saveEducation(String ticket, EmpEducationAddDTO empEducationAddDTO);


    /**
     * 修改员工教育经历
     * @param empEducationUpdateDTO 员工教育经历
     * @return 更新数量
     */
    @ApiOperation(value = "修改员工教育经历")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path"),
            @ApiImplicitParam(name = "empEducationUpdateDTO", dataType = "EmpEducationUpdateDTO", value = "修改员工教育经历", paramType = "body")
    })
    Result<Integer> updateEducation(String ticket, EmpEducationUpdateDTO empEducationUpdateDTO);




    /**
     * 删除单个员工教育经历，彻底删除
     * @param empEducationId 员工教育经历id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个员工教育经历，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path"),
            @ApiImplicitParam(name = "empEducationId", dataType = "String", value = "员工教育经历id", paramType = "path")
    })
    Result<Integer> deleteEducation(String ticket, String empEducationId);

    /**
     * 修改员工基础信息
     * @param empAllInfoDTO 员工信息
     * @return 更新数量
     */
    @ApiOperation(value = "修改员工所有信息(包括工作经历、联系人、教育经历等)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticket", dataType = "String", value = "ticket", paramType = "path"),
            @ApiImplicitParam(name = "empAllInfoDTO", dataType = "EmpAllInfoDTO", value = "修改员工所有信息(包括工作经历、联系人、教育经历等)", paramType = "body")
    })
    Result<Integer> updateEmpAllInfo(String ticket, @Valid @RequestBody EmpAllInfoDTO empAllInfoDTO);

    /**
     * 校验手机号是否绑定过微信
     * @param weChatBindFromOffAccountDTO 公众号跳转小程序绑定微信的参数
     * @return EmpInfoVO
     */
    @ApiOperation(value = "校验手机号是否绑定过微信")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "weChatBindFromOffAccountDTO", value = "公众号跳转小程序绑定微信的参数", dataType = "WeChatBindFromOffAccountDTO", paramType = "body")
    })
    Result<Boolean> checkPhoneBind(@RequestBody WeChatBindFromOffAccountDTO weChatBindFromOffAccountDTO);

}
